import request from '@/utils/request'

// 查询相关链接列表
export function listRelated_links(query) {
  return request({
    url: '/related_links/related_links/list',
    method: 'get',
    params: query
  })
}

// 查询相关链接详细
export function getRelated_links(id) {
  return request({
    url: '/related_links/related_links/' + id,
    method: 'get'
  })
}

// 新增相关链接
export function addRelated_links(data) {
  return request({
    url: '/related_links/related_links',
    method: 'post',
    data: data
  })
}

// 修改相关链接
export function updateRelated_links(data) {
  return request({
    url: '/related_links/related_links',
    method: 'put',
    data: data
  })
}

// 删除相关链接
export function delRelated_links(id) {
  return request({
    url: '/related_links/related_links/' + id,
    method: 'delete'
  })
}

// 启动文章爬虫
export function startCrawler() {
  return request({
    url: '/related_links/related_links/startCrawler',
    method: 'post'
  })
}

// 停止文章爬虫
export function stopCrawler() {
  return request({
    url: '/related_links/related_links/stopCrawler',
    method: 'post'
  })
}

// 获取爬虫状态
export function getCrawlerStatus() {
  return request({
    url: '/related_links/related_links/getStatus',
    method: 'get'
  })
}

// 获取爬虫进度
export function getCrawlerProgress() {
  return request({
    url: '/related_links/related_links/getProgress',
    method: 'get'
  })
}

// 定期清理与导出
export function cleanAndExport(period) {
  return request({
    url: '/related_links/related_links/clean-and-export',
    method: 'post',
    params: {
      period: period
    }
  })
}